import Vue from 'vue'
import VueRouter from 'vue-router'


// const Home = () =>
//     import ('../views/home/Home.vue')
// const Login = () =>
//     import ('../views/login/Login.vue')
// const Register = () =>
//     import ('../views/login/Register.vue')
// const PublishShort = () =>
//     import ('../views/publish/short/PublishShort.vue')
// const PublishJob = () =>
//     import ('../views/publish/job/PublishJob.vue')
// const PublishNotice = () =>
//     import ('../views/publish/notice/PublishNotice.vue')
// const PublishMarket = () =>
//     import ('../views/publish/market/PublishMarket.vue')
// const Task = () =>
//     import ('../views/task/Task.vue')
// const Details = () =>
//     import ('../views/details/Details.vue')
// const Search = () =>
//     import ('../views/search/Search.vue')
//     // const BeingDetails = () =>
//     //     import ('../views/details/BeingDetails.vue')
// const User = () =>
//     import ('../views/user/User.vue')
// const FinishedDetails = () =>
//     import ('../views/details/FinishedDetails.vue')
// const Chat = () =>
//     import ('../views/chat/Chat.vue')
// const Change = () =>
//     import ('../views/user/Change.vue')
// const Message = () =>
//     import('../views/chat/Message.vue')

// Vue.use(VueRouter)

// const routes = [{
//             // 首次进页面重定向路由为home主页
//             path: '/',
//             redirect: 'home'
//         },
//         // 首页的路由
//         {
//             path: '/home',
//             name: 'Home',
//             component: Home
//         },
//         // 登录的路由
//         {
//             path: '/login',
//             name: 'login',
//             component: Login
//         },
//         // 注册的路由
//         {
//             path: '/register',
//             name: 'register',
//             component: Register
//         },
//         // 发布短时效任务的路由
//         {
//             path: '/publishshort',
//             name: 'publishshort',
//             component: PublishShort
//         },
//         // 发布兼职任务的路由
//         {
//             path: '/publishjob',
//             name: 'publishjob',
//             component: PublishJob
//         },
//         // 发布公告任务的路由
//         {
//             path: '/publishnotice',
//             name: 'publishnotice',
//             component: PublishNotice
//         },
//         // 发布二手市场的路由
//         {
//             path: '/publishmarket',
//             name: 'publishmarket',
//             component: PublishMarket
//         },
//         // 四类悬赏任务的路由
//         {
//             path: '/task',
//             name: 'task',
//             component: Task
//         },
//         // 详情页面
//         {
//             path: '/details',
//             name: 'details',
//             component: Details
//         },
//         // 正在进行的详情页面
//         // {
//         //   path: '/beingdetails',
//         //   name: 'beingdetails',
//         //   component: BeingDetails
//         // },
//         // 搜索页面
//         {
//             path: '/search',
//             name: 'search',
//             component: Search
//         },
//         // 用户个人界面
//         {
//             path: '/user',
//             name: 'user',
//             component: User
//         },
//         // 结束订单的评价页面
//         {
//             path: '/finishedDetails',
//             name: 'finisheddetails',
//             component: FinishedDetails
//         },
//         // 私聊页面
//         {
//             path: '/chat',
//             name: 'chat',
//             component: Chat
//         },
//         // 个人信息修改页面
//         {
//             path: '/change',
//             name: 'change',
//             component: Change
//         }
const Home = () =>
    import ('../views/home/Home.vue')
const Login = () =>
    import ('../views/login/Login.vue')
const Register = () =>
    import ('../views/login/Register.vue')
const PublishShort = () =>
    import ('../views/publish/short/PublishShort.vue')
const PublishJob = () =>
    import ('../views/publish/job/PublishJob.vue')
const PublishNotice = () =>
    import ('../views/publish/notice/PublishNotice.vue')
const PublishMarket = () =>
    import ('../views/publish/market/PublishMarket.vue')
const Task = () =>
    import ('../views/task/Task.vue')
const Details = () =>
    import ('../views/details/Details.vue')
const Search = () =>
    import ('../views/search/Search.vue')
const User = () =>
    import ('../views/user/User.vue')
const FinishedDetails = () =>
    import ('../views/details/FinishedDetails.vue')
const Chat = () =>
    import ('../views/chat/Chat.vue')
const Change = () =>
    import ('../views/user/Change.vue')
const Message = () =>
    import ('../views/chat/Message.vue')
const Identity = () =>
    import ('../views/user/Identity.vue')

Vue.use(VueRouter)

const routes = [{
        // 首次进页面重定向路由为home主页
        path: '/',
        redirect: 'home'
    },
    // 首页的路由
    {
        path: '/home',
        name: 'home',
        component: Home
    },
    // 登录的路由
    {
        path: '/login',
        name: 'login',
        component: Login
    },
    // 注册的路由
    {
        path: '/register',
        name: 'register',
        component: Register
    },
    // 发布短时效任务的路由
    {
        path: '/publishshort',
        name: 'publishshort',
        component: PublishShort
    },
    // 发布兼职任务的路由
    {
        path: '/publishjob',
        name: 'publishjob',
        component: PublishJob
    },
    // 发布公告任务的路由
    {
        path: '/publishnotice',
        name: 'publishnotice',
        component: PublishNotice
    },
    // 发布二手市场的路由
    {
        path: '/publishmarket',
        name: 'publishmarket',
        component: PublishMarket
    },
    // 四类悬赏任务的路由
    {
        path: '/task',
        name: 'task',
        component: Task
    },
    // 详情页面
    {
        path: '/details',
        name: 'details',
        component: Details
    },
    // 搜索页面
    {
        path: '/search',
        name: 'search',
        component: Search
    },
    // 用户个人界面
    {
        path: '/user',
        name: 'user',
        component: User
    },
    // 结束订单的评价页面
    {
        path: '/finishedDetails',
        name: 'finisheddetails',
        component: FinishedDetails
    },
    // 私聊页面
    {
        path: '/chat',
        name: 'chat',
        component: Chat
    },
    // 个人信息修改页面
    {
        path: '/change',
        name: 'change',
        component: Change
    },
    // 消息页面
    {
        path: '/message',
        name: 'message',
        component: Message
    },
    // 上传身份信息认证界面
    {
        path: '/identity',
        name: 'identity',
        component: Identity
    }
]

const router = new VueRouter({
    mode: 'hash',
    base: process.env.BASE_URL,
    routes
})

export default router